﻿using DelonixRegia.Classes.Home;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DelonixRegia
{
    public partial class defaultPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                lblRmOccupied.Text = HomeStatisticsDBManager.getNoRoomsOccupied().ToString();
                lblEmptyRoom.Text = (HomeStatisticsDBManager.getTotalRooms() - int.Parse(lblRmOccupied.Text)).ToString();
                lblOccupancy.Text = Math.Round(((double.Parse(lblRmOccupied.Text)) / (double.Parse(lblEmptyRoom.Text))) * 100, 2).ToString();

                lblTotalGuest.Text = HomeStatisticsDBManager.getTotalGuestNow().ToString();
                lblToday.Text = HomeStatisticsDBManager.getTodayCheckinCount().ToString();
                lblDueCheckout.Text = HomeStatisticsDBManager.getDueCheckoutCount().ToString();

                lblTotalRevenue.Text = Math.Round(HomeStatisticsDBManager.getTotalRevenue(), 2).ToString();
                lblGSTCollected.Text = Math.Round(Convert.ToDouble(lblTotalRevenue.Text) * 0.07, 2).ToString();
                lblNetRevenue.Text = Math.Round(Convert.ToDecimal(lblTotalRevenue.Text) - Convert.ToDecimal(lblGSTCollected.Text), 2).ToString();
            }
        }
    }
}